<?php
class Page_Block_Head extends Core_Block_Template {

	protected $_items = array();
	
	public function addJs($script) {
		$this->addItem('js', $script);
	}
	
	public function getJs() {
		return $this->getItem('js') ? $this->getItem('js') : array();
	}
	
	public function addCss($stylesheet) {
		$this->addItem('css', $stylesheet);
	}

	public function getCss() {
		return $this->getItem('css') ? $this->getItem('css') : array();
	}

	public function addItem($type, $src) {
		if (!isset($this->_items[$type])) 
			$this->_items[$type] = array();
		array_push($this->_items[$type], $this->getSkinUrl($src));
	}
	
	public function getItem($type) {
		return isset($this->_items[$type]) ? $this->_items[$type] : null;
	}
	
	public function getFaviconFile() {
		// get from config (db)
		return $this->getSkinUrl('favicon.png');
	}

	public function getTitle() {
		// get from config (db)
		return 'Mag';
	}
	
	public function getRobots() {
		// get from config (db)
		return 'INDEX,FOLLOW';
	}
	
	public function getKeywords() {
		// get from config (db)
		return 'Mag, CMS, OpenSource';
	}
	
	public function getDescription() {
		// get from config (db)
		return 'Mage framework';
	}
}
